package ro.sergiu.finder.models.frame;

import java.awt.Dimension;
import java.io.Serializable;
import ro.sergiu.finder.models.property.DisplayMode;

public class FrameModel implements Serializable {

    protected String title = "Selectie";
    protected boolean resizable = true;
    protected Dimension size = new Dimension(585, 344);
    protected Dimension preferredSize = new Dimension(452, 469);
    protected Dimension maximumSize = new Dimension(2147483647, 2147483647);
    protected Dimension minimumSize = new Dimension(316, 282);
    protected DisplayMode displayMode = DisplayMode.MODAL_DIALOG;

    public FrameModel() {
    }

    public FrameModel(String title, Dimension size, Dimension preferredSize, Dimension maximumSize, Dimension minimumSize, boolean resizable) {
        this.title = title;
        this.size = size;
        this.preferredSize = preferredSize;
        this.maximumSize = maximumSize;
        this.minimumSize = minimumSize;
        this.resizable = resizable;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public boolean isResizable() {
        return resizable;
    }

    public void setResizable(boolean resizable) {
        this.resizable = resizable;
    }

    public Dimension getSize() {
        return size;
    }

    public void setSize(Dimension size) {
        this.size = size;
    }

    public Dimension getPreferredSize() {
        return preferredSize;
    }

    public void setPreferredSize(Dimension preferredSize) {
        this.preferredSize = preferredSize;
    }

    public Dimension getMaximumSize() {
        return maximumSize;
    }

    public void setMaximumSize(Dimension maximumSize) {
        this.maximumSize = maximumSize;
    }

    public Dimension getMinimumSize() {
        return minimumSize;
    }

    public void setMinimumSize(Dimension minimumSize) {
        this.minimumSize = minimumSize;
    }

    public DisplayMode getDisplayMode() {
        return displayMode;
    }

    public void setDisplayMode(DisplayMode displayMode) {
        this.displayMode = displayMode;
    }

    @Override
    public String toString() {
        StringBuilder toString = new StringBuilder();
        toString.append("title=").append(title).append("; ");
        toString.append("resizable=").append(resizable).append("; ");
        toString.append("size=").append(size).append("; ");
        toString.append("preferredSize=").append(preferredSize).append("; ");
        toString.append("maximumSize=").append(maximumSize).append("; ");
        toString.append("minimumSize=").append(minimumSize).append("; ");
        return toString.toString();
    }

    @Override
    public int hashCode() {
        int hash = 7;
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final FrameModel other = (FrameModel) obj;
        if ((this.title == null) ? (other.title != null) : !this.title.equals(other.title)) {
            return false;
        }
        if (this.resizable != other.resizable) {
            return false;
        }
        if (this.size != other.size && (this.size == null || !this.size.equals(other.size))) {
            return false;
        }
        if (this.preferredSize != other.preferredSize && (this.preferredSize == null || !this.preferredSize.equals(other.preferredSize))) {
            return false;
        }
        if (this.maximumSize != other.maximumSize && (this.maximumSize == null || !this.maximumSize.equals(other.maximumSize))) {
            return false;
        }
        if (this.minimumSize != other.minimumSize && (this.minimumSize == null || !this.minimumSize.equals(other.minimumSize))) {
            return false;
        }
        if (this.displayMode != other.displayMode) {
            return false;
        }
        return true;
    }

}
